package com.jt.handler;

import com.jt.msg.req.LogoutMsg;
import com.jt.msg.resp.CommonResp;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import org.springframework.stereotype.Component;

/**
 * 退出
 *
 * @author wang xiao
 * date 2023/8/9
 */

@Component
@ChannelHandler.Sharable
public class LogoutMsgHandler extends BaseHandler<LogoutMsg> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, LogoutMsg msg) throws Exception {
        log.debug(msg.toString());
        CommonResp resp = CommonResp.success(msg, getSerialNumber(ctx.channel()));
        write(ctx, resp);
    }
}
